#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008  Vladimir Lagunov

import time
from config import *

class Timer:
	def __init__(self, n):
		self._start = time.time()
		self._time = n
	def flush(self):
		self._start = time.time()
	def setWait(self, n):
		self._time = n
	def getWait(self):
		return self._time
	def is_end(self):
		return (time.time() >= self._start + self._time)
	def count(self):
		return time.time()-self._start
